import { requestInterceptors, responseInterceptors } from './interceptors.js'
import { http } from 'uview-plus'
//  初始化请求配置
const initRequest = (vm) => {
  http.setConfig((defaultConfig) => {
    defaultConfig.baseURL = vm.config.globalProperties.$global.baseUrl /* 根域名 */
    return defaultConfig
  })
  requestInterceptors()
  responseInterceptors()
}
export {
  initRequest
}